from django.contrib import admin
from models import Category, Record

class RecordAdmin(admin.ModelAdmin):
    list_display = ('format_publish_date', 'title', 'views', 'status', 'category')
    list_filter = ('publish_date', 'status')
    search_fields = ('title', )
    ordering = ('-publish_date',)

    def format_publish_date(self, obj):
        return "%s" % obj.publish_date


admin.site.register(Category)
admin.site.register(Record, RecordAdmin)
